<!--  -->
<template>
  <div class="setcard">
    <div class="contrd">
      <div class="leftc">
        <img src="@/static/img/cards.png" alt="" />
      </div>
      <div class="rgtc">
        <div class="tops">
          <h3>名片信息介绍</h3>
          <span class="ictxt">
            <i class="el-icon-warning-outline"></i>
            该模块用于在名片页展示员工个人信息，可自定义名片展示样式及名片中展示的信息，便于对员工名片进行统一化管理。
          </span>
        </div>
        <div class="cardset">
          <h3>名片内容设置</h3>
          <div class="xuan">
            <el-radio v-model="radio" label="1" @change="isUser = !isUser">电子名片</el-radio>
            <el-radio v-model="radio" label="2" @change="isUser = !isUser">纸质名片</el-radio>
          </div>
          <div class="showone" v-if="isUser">
            <h5>名片显示项</h5>
            <span style="color: #9b9b9b"
              ><i class="el-icon-warning-outline"></i>
              选择的字段将从员工信息中取值，员工不可编辑修改，如有修改需要联系管理员调整。</span
            >
            <div class="btons">
              <el-button>手机号</el-button>
              <el-button>单位名称</el-button>
              <el-button>座机号</el-button>
              <el-button>部门</el-button>
              <el-button>地址</el-button>
              <el-button>职位</el-button>
              <el-button>头像</el-button>
            </div>
            <h5>个人头像</h5>
            <el-upload action="#" list-type="picture-card" :auto-upload="false">
              <i slot="default" class="el-icon-plus"></i>
              <div slot="file" slot-scope="{ file }">
                <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
                <span class="el-upload-list__item-actions">
                  <span
                    class="el-upload-list__item-preview"
                    @click="handlePictureCardPreview(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    v-if="!disabled"
                    class="el-upload-list__item-delete"
                    @click="handleDownload(file)"
                  >
                    <i class="el-icon-download"></i>
                  </span>
                  <span
                    v-if="!disabled"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
              <img width="80px" :src="dialogImageUrl" alt="" />
            </el-dialog>
            <span>建议格式为png、jpg高清图片，图片大小不的高于5M。</span>
            <div class="mels" :class="{ active: isChang }">
              <h5 class="ts">资料信息</h5>
              <span
                ><i class="el-icon-warning-outline"></i>
                此资料信息调取个人信息数据，员工没有修改权限，如需要修改请联系管理员。</span
              >
              <ul class="puts">
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">姓名</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">手机号</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">公司/单位名</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">座机号</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">部门</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">职位</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">邮箱</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">微信</h5>
                  </el-input>
                </li>
                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">自我介绍</h5>
                  </el-input>
                </li>

                <li>
                  <el-input placeholder="请输入内容" v-model="input2">
                    <h5 slot="suffix">地址</h5>
                  </el-input>
                </li>
              </ul>
            </div>
          </div>
          <div class="showtwo" v-else>
            <h5>上传纸质名片</h5>
            <span><i class="el-icon-warning-outline"></i>
              上传纸质名片的电子文档，如没有电子文档也可拍照再上传。</span
            >
            <div class="os">
            <el-upload action="#" list-type="picture-card" :auto-upload="false">
              <i slot="default" class="el-icon-plus"></i>
              <div slot="file" slot-scope="{ file }">
                <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
                <span class="el-upload-list__item-actions">
                  <span
                    class="el-upload-list__item-preview"
                    @click="handlePictureCardPreview(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    v-if="!disabled"
                    class="el-upload-list__item-delete"
                    @click="handleDownload(file)"
                  >
                    <i class="el-icon-download"></i>
                  </span>
                  <span
                    v-if="!disabled"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
              <img width="80px" :src="dialogImageUrl" alt="" />
            </el-dialog>
             <span>建议格式为png、jpg高清图片，图片大小不的高于5M。</span>
             </div>
        </div>
      </div>
    </div>
    <div class="botm">
      <Btns />
    </div>
  </div>
  </div>
</template>

<script>
import Btns from '@/components/admin/card/Btns.vue'
export default {
  components: {
    Btns,
  },
  data() {
    return {
      isUser: true,
      isChang: false,
      input1: '',
      input2: '',
      input3: '',
      select: '',
      dialogImageUrl: '',
      dialogVisible: false,
      disabled: false,
      radio: '1',
      radios: '1',
    }
  },
  created() {},
  methods: {
    handleRemove(file) {
      console.log(file)
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url
      this.dialogVisible = true
    },
    handleDownload(file) {
      console.log(file)
    },
    cangs(isChang) {
      this.isChang = true
      console.log(isChang)
      console.log(this.isChang)
    },
  },

  // mounted() {
  //   this.$refs.gan.style.display = 'none'
  // },
  computed: {
    cang(isChang) {
      console.log(isChang)
      console.log(1111)
    },
  },
}
</script>
<style lang='scss'>
.active {
  display: none;
}

.setcard {
  width: 100%;
  display: flex;
  flex-grow: 1;
  flex-wrap: wrap;
background: #fff;
  .contrd {
    margin-top: 53px;
    width: 100%;
    height: 874px;
    background: #fff;
    display: flex;
    flex-grow: 1;
    flex-wrap: wrap;
    border-bottom: 1px solid #f0f2f5;
    .leftc {
      display: flex;
      flex: 1;
      height: 710px;
      justify-content: center;
      img {
        display: block;
        width: 355px;
        height: 682px;
        border-radius: 45px;
      }
    }
    .rgtc {
      width: 800px;
      height: 741px;
      margin-right: 52px;
      .tops {
        width: 100%;
        height: 67px;

        h3 {
          font-size: 16px;
          font-family: PingFangSC, PingFangSC-Semibold;
          font-weight: 600;
          text-align: left;
          color: #171725;
          line-height: 22px;
          letter-spacing: 0.11px;
        }
        .ictxt {
          font-size: 13px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          color: #9b9b9b;
          letter-spacing: 0.09px;
          height: 34.61px;
          margin-bottom: 40px;
        }
      }
      .cardset {
        margin-top: 32px;
        width: 100%;
        height: auto;
        span {
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          font-size: 13px;
          color: #9b9b9b;
          line-height: 18px;
          letter-spacing: 0.09px;
        }
        h3 {
          font-size: 16px;
          font-family: PingFangSC, PingFangSC-Semibold;
          font-weight: 600;
          text-align: left;
          color: #171725;
          line-height: 22px;
          letter-spacing: 0.11px;
        }
        .xuan {
          width: 100%;
          height: 20px;
          margin-bottom: 29px;
          display: flex;
          div {
            margin-right: 73px;
          }
        }
        .btons {
          margin-top: 12px;
          margin-bottom: 30px;
          display: flex;
          width: 100%;
          height: 32px;
          .el-button {
            width: 81px;
            height: 32px;
            text-align: center;
            border: 1px solid #005fff;
            line-height: 32px;
            span {
              display: block;
              width: auto;
              height: 20px;
              margin: -9px;
              line-height: 20px;
              color: #005fff;
            }
          }
        }
        .el-upload--picture-card {
          background-color: #fbfdff;
          border: 1px dashed #c0ccda;
          border-radius: 6px;
          box-sizing: border-box;
          width: 80px;
          height: 80px;
          cursor: pointer;
          line-height: 80px;
          vertical-align: top;
        }
        .mels {
          display: block;
          width: 100%;
          height: auto;
          .ts {
            margin: 30px 0 9px;
            font-size: 14px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: left;
            color: #333333;
            line-height: 22px;
          }
          h5 {
            line-height: 40px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #444450;
            margin: 0;
          }
          .puts {
            height: 252px;
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            flex-grow: 1;
            list-style: none;

            li {
              width: 320px;
              height: 36px;
              border-radius: 10px;
              margin: 20px 20px 0 0;
              .el-input-group {
                width: 100%;
                input {
                  border-radius: 10px !important;
                }
              }
              .el-input-group__suffix {
                background: #fff;
                border: 0;
              }
            }
          }
        }
        .os{
          margin-top: 10px;
        }
      }
    }
  }
  .botm {
    width: 100%;
    height: 80px;
    border-top: 1px solid ;
  }
}
</style>
